package springboot.p2.resource;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Service;

/**
 * @description: 使用Value获取属性文件值
 * @author: lzp
 * @createTime: 2021-08-28 00:47
 **/
@Service
@PropertySource("classpath:springboot/p2/resource/test.properties")
public class ValueService {

    @Value("${book.author}")
    private String author;

    @Value("${book.name}")
    private String name;

    public String getAuthor() {
        return author;
    }

    public String getName() {
        return name;
    }
}
